Hello again
This is a follow to my previous post "Assembly Language Question".
This post is about labels and the different results I get.
See comments in the assembly listing below.
As I understand, the "cmp" instruction supports the operands below.
1 cmp reg, memory
2 cmp memory, reg
3 cmp reg, reg
4 cmp memory, immediate
5 cmp reg, immediate
I believe I am using number 4 in the test code below?
(The contents pointed to by the address compared to an immediate value)
Any help appreciated.
Thanks John
; ------------------------------------------------------------
15 org 369h
; label1 has no colon yet appears to be legal? TASM specific?
16 0369 11 label1 db 11h
17 036A 22 label2: db 22h
18 036B label3:
19 036B 33 db 33h
20
21 org 1234h
24 1234 80 3E 0369r 11 cmp label1, 11h ; Correct assembly. No colon
25 1239 83 3E 036Ar 22 cmp label2, 22h ; Error: Colon present.
; Argument to operation or instruction has illegal size
26 123E 83 3E 036Br 33 cmp label3, 33h ; Error: Colon present.
; Argument to operation or instruction has illegal size
27 1243 80 3E 036Ar 18 cmp [byte ptr label2], 18h ; Correct assembly.
Colon present.
; Example from previous post
29 1248 80 3E 0369 18 cmp byte ptr [addr], 18h ; Error:
; Illegal immediate
30 124D 80 3E 0369 18 cmp [byte ptr addr], 18h ; Error: Colon present.
; Illegal immediate
; end doc
_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user