• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

why won't my assembly program compile correctly?

amdskip

Lifer
Never done assembly before so I'm a newb.
Program must do: X = (A-(B-C)) - (D-(E-F)) and we cannot simplify it says.

This must be done in old style if that makes sense.

Here's what I have:

.model tiny
.code startupcode
mov ax,b
sub ax,c
mov bx,a
sub bx,ax
mov cx,e
sub cx,f
mov dx,d
sub dx,cx
sub bx,dx
mov x,bx
exitcode
a dw 4
b dw 3
c dw 1
d dw 2
e dw 1
f dw 0
x dw 0
end
 
.model tiny
.code startupcode
mov ax,b
sub ax,c
mov bx,a
sub bx,ax
mov cx,e
sub cx,f
mov dx,d
sub dx,cx
sub bx,dx
mov x,bx
exitcode
a dw 4
b dw 3
c dw 1
d dw 2
e dw 1
f dw 0
end

x is undefined?

Lico
 
Originally posted by: Lico
.model tiny
.code startupcode
mov ax,b
sub ax,c
mov bx,a
sub bx,ax
mov cx,e
sub cx,f
mov dx,d
sub dx,cx
sub bx,dx
mov x,bx
exitcode
a dw 4
b dw 3
c dw 1
d dw 2
e dw 1
f dw 0
end

x is undefined?

Lico

doh! 😛 I didn't even catch that!
 
Back
Top