News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

The Basics

Started by creature0077, October 12, 2005, 11:35:27 PM

Previous topic - Next topic

MusicalMike

A struct is sort of like a template for a compositedatastructure. Basicly, struct is short for data structure. In order to understand a class, you really need to learn a hybrid language like c++ or a pure oop language like c#. (Please stay away from java). A class is similar to a data structure, but unlike datastructures, they are more like actual types like int or char (again, its something thats easier to grasp if you are familior with c++). Neither of them are anything like a function. A function is simply a subroutine that takes arguments, makes computations based on those arguments, and returns a result.

creature0077

ok, I'm good on my 32-bit version of the program now.  making it into a 16-bit is a little bit confusing for me.  I'm not clear on how to fix what errors I get. 
;--------------------------------------------------------------------
; Assignment 1 for CSE 2312.001
; Using different Address modes in 16-bit
;
; author: Ben Williams
;--------------------------------------------------------------------

.model small, stdcall
.stack 4096

.data
B WORD 2, 4, 6, 8

.data?
A WORD ?
D WORD 6 DUP(?)

.code

Start:
mov ax, @data
mov ds, ax

mov A, 15h ;immediate mode, 15h into vari A
mov bx, 50h
mov [A], bx ;indirect mode, 50h into vari A
mov cx, [B+0Ch] ;indexed mode, move 4th element to register
mov bp, 02h
mov cl, [B+bp+06h]      ;based indexed mode, move 3rd to register
mov [D+08h], cl ;move register from B to D using indexed mode


mov ax, 4c00h
int 21h

End Start

ninjarider

the only error i get when assembly your above code is your last line before u setup the exit, mov [D+08h], cl.

mov A, 15h
mov bx, 50h
mov [A], bx
mov cx, [B+0Ch]      <-- clue
mov bp, 02h
mov cl, [B+bp+06h]  <-- problem
mov [D+08h], cl       <-- problem