Difference between revisions of "CSC231 Homework 3 Solutions 2010"
(→hw3b.asm) |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
--[[User:Thiebaut|D. Thiebaut]] 14:18, 15 October 2010 (UTC) | --[[User:Thiebaut|D. Thiebaut]] 14:18, 15 October 2010 (UTC) | ||
---- | ---- | ||
+ | <onlysmith> | ||
+ | |||
=hw3a.asm= | =hw3a.asm= | ||
<code><pre> | <code><pre> | ||
Line 47: | Line 49: | ||
add ah, byte[tableb] ; add "1" to ah | add ah, byte[tableb] ; add "1" to ah | ||
mov byte[tablew], ah ; ah -> 1st B of tablew | mov byte[tablew], ah ; ah -> 1st B of tablew | ||
+ | |||
;; using a word | ;; using a word | ||
mov ax, word[tableb+1] ; "10" and "0xff" -> ax | mov ax, word[tableb+1] ; "10" and "0xff" -> ax | ||
mov byte[tablew+1*2], al ; "10" -> 3rd B of tablew | mov byte[tablew+1*2], al ; "10" -> 3rd B of tablew | ||
mov byte[tablew+2*2], ah ; "0xff" -> 5th B of tablew | mov byte[tablew+2*2], ah ; "0xff" -> 5th B of tablew | ||
+ | |||
;; using a double word | ;; using a double word | ||
mov eax, dword[tableb+3] ; "5", "0x0a", "01" -> eax | mov eax, dword[tableb+3] ; "5", "0x0a", "01" -> eax | ||
Line 204: | Line 208: | ||
int 0x80 ; final system call | int 0x80 ; final system call | ||
</pre></code> | </pre></code> | ||
− | + | </onlysmith> | |
<br /> | <br /> | ||
<br /> | <br /> |
Latest revision as of 12:20, 14 December 2010
--D. Thiebaut 14:18, 15 October 2010 (UTC)