From 7b109ab6528bfafa6ac8fd9340e5cc0217bcec50 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 9 Jan 2021 19:02:23 -0800 Subject: 7494 --- html/baremetal/ex2.subx.html | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) (limited to 'html/baremetal/ex2.subx.html') diff --git a/html/baremetal/ex2.subx.html b/html/baremetal/ex2.subx.html index e150cc4a..3d27392c 100644 --- a/html/baremetal/ex2.subx.html +++ b/html/baremetal/ex2.subx.html @@ -16,6 +16,7 @@ a { color:inherit; } * { font-size:12pt; font-size: 1em; } .subxComment { color: #005faf; } .LineNr { } +.subxFunction { color: #af5f00; text-decoration: underline; } .Constant { color: #008787; } --> @@ -64,30 +65,27 @@ if ('onhashchange' in window) { 10 # Expected output: 11 # html/baremetal.png 12 -13 # main: (address 0x8800) -14 -15 == code +13 main: +14 # ecx <- start of video memory +15 8b/-> *0x7f28 1/r32/ecx 16 -17 # ecx <- start of video memory -18 8b/-> *0x7f28 1/r32/ecx +17 # eax <- final pixel of video memory +18 8d/copy-address *(ecx + 0x0bffff) 0/r32/eax # 0xbffff = 1024*768 - 1 19 -20 # eax <- final pixel of video memory -21 8d/copy-address *(ecx + 0x0bffff) 0/r32/eax # 0xbffff = 1024*768 - 1 -22 -23 # for each pixel in video memory -24 { -25 39/compare %eax 1/r32/ecx -26 7c/jump-if-< break/disp8 -27 # write its column number to it -28 88/byte<- *eax 0/r32/AL -29 48/decrement-eax -30 eb/jump loop/disp8 -31 } -32 -33 # hang indefinitely -34 { -35 eb/jump loop/disp8 -36 } +20 # for each pixel in video memory +21 { +22 39/compare %eax 1/r32/ecx +23 7c/jump-if-< break/disp8 +24 # write its column number to it +25 88/byte<- *eax 0/r32/AL +26 48/decrement-eax +27 eb/jump loop/disp8 +28 } +29 +30 # hang indefinitely +31 { +32 eb/jump loop/disp8 +33 } -- cgit 1.4.1-2-gfad0