Skip to main content

Thread: dividing usgigned/signed byte


bnum1 db 25 bnum2 db 17 bnum3 db 8 bnum4 db 17 bnum5 db -6 bnum6 db -19
wans12=289
unsigned
; bans18 = wans12 / bnum3 ; brem18 = modulus (wans12 / bnum3) keep getting wrong answer these
0x804926a <bans16>: 3
0x804926b <bans17>: 2
0x804926c <bans18>: 4
0x804926d <brem18>: 1
0x804926e <bans19>: -2
0x804926f <bans20>: 3
0x8049270 <bans21>: 6
0x8049271 <brem21>: 0

; unsigned byte division
; bans16 = bnum1 / bnum3
; bans17 = bnum4 / bnum3
; bans18 = wans12 / bnum3
; brem18 = modulus (wans12 / bnum3)
mov al,[bnum1]
mov ah,0
div byte [bnum3]
mov [bans16],al
mov al,[bnum4]
mov ah,0
div byte [bnum3]
mov [bans17],al
mov al,[wans12]
mov ah,0
div byte [bnum3]
mov [bans18],al
mov [brem18],ah

mixing signed , unsigned types can of worms.
you'd better ask @ programming forum.


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk dividing usgigned/signed byte


Ubuntu

Comments

Popular posts from this blog

Warning, the Safe Path is not accessible vm3 - Joomla! Forum - community, help and support

uppercase letters in url - Joomla! Forum - community, help and support

Joomla! Update is not offering Joomla 3 - Joomla! Forum - community, help and support