|
Post by Emil_halim on Apr 16, 2018 20:13:30 GMT 1
Hi all
what is wrong with this code , it must print 1 & 2
Dim kp As Pointer header Pointer(kp) = LabelAddr(adres)
Print kp.a1 // should be 1 but 255 Print kp.a2 // should be 2 but 85
. mov eax, kp . mov ax, wpt[ eax] GetRegs Print " " & Str$(_AL) & " " & Str$(_AH)
Do Sleep Until Me Is Nothing End
Type header - Byte a1 - Byte a2 End Type
adres: . db 1 . db 2
|
|
|
Post by scalion on Apr 16, 2018 22:12:26 GMT 1
Hi, Your code is good but you did not compile the program and run it in interpretor. It is probably the internal start and end of line codes that appear in the memory (255,85,180). Once compiled the program gives the right result. That said, to adapt your code in interpretor mode you can use the IsExe statement and by relocating
. db 1 . db 2
by :
. db 1,2
And LabelAddr(adres) by LabelAddr(adres)+3
Your program will normaly have the result expected.
|
|
|
Post by Emil_halim on Apr 17, 2018 17:16:20 GMT 1
thank you
This information will help me a lot.
|
|