From 63a247fcd4c7597c93e28fc92e489a7882ae2d7c Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 29 Dec 2020 20:50:55 -0800 Subject: 7468 --- html/baremetal/ex1.hex.html | 2 +- html/baremetal/ex2.hex.html | 59 +++++++++++++++++++++++--------------------- html/baremetal/ex2.subx.html | 51 +++++++++++++++++++------------------- html/baremetal/ex3.hex.html | 2 +- 4 files changed, 59 insertions(+), 55 deletions(-) (limited to 'html') diff --git a/html/baremetal/ex1.hex.html b/html/baremetal/ex1.hex.html index 92c4ab4e..ff7fef1e 100644 --- a/html/baremetal/ex1.hex.html +++ b/html/baremetal/ex1.hex.html @@ -64,7 +64,7 @@ if ('onhashchange' in window) { 11 # To run: 12 # qemu-system-i386 disk.img 13 # Or: -14 # bochs -f apps/boot.bochsrc # boot.bochsrc loads disk.img +14 # bochs -f baremetal/boot.bochsrc # boot.bochsrc loads disk.img 15 16 # main: (address 0x8800) 17 e9 fb ff ff ff # jump to address 0x8800 diff --git a/html/baremetal/ex2.hex.html b/html/baremetal/ex2.hex.html index 42eae7b3..1d9e1418 100644 --- a/html/baremetal/ex2.hex.html +++ b/html/baremetal/ex2.hex.html @@ -61,35 +61,38 @@ if ('onhashchange' in window) { 8 # To run: 9 # qemu-system-i386 disk.img 10 # Or: -11 # bochs -f apps/boot.bochsrc # boot.bochsrc loads disk.img -12 -13 # main: (address 0x8800) -14 -15 # ecx <- LFB -16 8b # copy *rm32 to r32 -17 0d # 00/mod/indirect 001/r32/ecx 101/rm32/use-disp32 -18 28 7f 00 00 # disp32 [label] -19 -20 # eax <- LFB + 0xbffff (1024*768 - 1) -21 8d # copy-address rm32 to r32 -22 81 # 10/mod/*+disp32 000/r32/eax 001/rm32/ecx -23 ff ff 0b 00 # disp32 -24 -25 # $loop: -26 # if (eax < ecx) break -27 39 # compare rm32 with r32 -28 c8 # 11/mod/direct 001/r32/ecx 000/rm32/eax -29 7c 05 # break if < [label] -30 # *eax <- al -31 88 # copy r8 to m8 at r32 -32 00 # 00/mod/indirect 000/r8/AL 000/rm32/eax -33 48 # decrement eax -34 eb f7 # loop to -9 bytes [label] -35 -36 # $break: -37 e9 fb ff ff ff # hang indefinitely +11 # bochs -f baremetal/boot.bochsrc # boot.bochsrc loads disk.img +12 # +13 # Expected output: +14 # html/baremetal.png +15 +16 # main: (address 0x8800) +17 +18 # ecx <- LFB +19 8b # copy *rm32 to r32 +20 0d # 00/mod/indirect 001/r32/ecx 101/rm32/use-disp32 +21 28 7f 00 00 # disp32 [label] +22 +23 # eax <- LFB + 0xbffff (1024*768 - 1) +24 8d # copy-address rm32 to r32 +25 81 # 10/mod/*+disp32 000/r32/eax 001/rm32/ecx +26 ff ff 0b 00 # disp32 +27 +28 # $loop: +29 # if (eax < ecx) break +30 39 # compare rm32 with r32 +31 c8 # 11/mod/direct 001/r32/ecx 000/rm32/eax +32 7c 05 # break if < [label] +33 # *eax <- al +34 88 # copy r8 to m8 at r32 +35 00 # 00/mod/indirect 000/r8/AL 000/rm32/eax +36 48 # decrement eax +37 eb f7 # loop to -9 bytes [label] 38 -39 # vim:ft=subx +39 # $break: +40 e9 fb ff ff ff # hang indefinitely +41 +42 # vim:ft=subx diff --git a/html/baremetal/ex2.subx.html b/html/baremetal/ex2.subx.html index ae4eb8a8..12c06aeb 100644 --- a/html/baremetal/ex2.subx.html +++ b/html/baremetal/ex2.subx.html @@ -60,33 +60,34 @@ if ('onhashchange' in window) { 6 # qemu-system-i386 disk.img 7 # Or: 8 # bochs -f baremetal/boot.bochsrc # boot.bochsrc loads disk.img - 9 -10 # main: (address 0x8800) -11 -12 == code -13 -14 # ecx <- start of video memory -15 8b/-> 0/mod/indirect 5/rm32/use-disp32 0x7f28/disp32/video-memory 1/r32/ecx + 9 # +10 # Expected output: +11 # html/baremetal.png +12 +13 # main: (address 0x8800) +14 +15 == code 16 -17 # eax <- final pixel of video memory -18 8d/copy-address *(ecx + 0x0bffff) 0/r32/eax # 0xbffff = 1024*768 - 1 +17 # ecx <- start of video memory +18 8b/-> *0x7f28 1/r32/ecx 19 -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 } -34 -35 # vim:ft=subx +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 } diff --git a/html/baremetal/ex3.hex.html b/html/baremetal/ex3.hex.html index ccb3422c..24d978d3 100644 --- a/html/baremetal/ex3.hex.html +++ b/html/baremetal/ex3.hex.html @@ -61,7 +61,7 @@ if ('onhashchange' in window) { 8 # To run: 9 # qemu-system-i386 disk.img 10 # Or: -11 # bochs -f apps/boot.bochsrc # boot.bochsrc loads disk.img +11 # bochs -f baremetal/boot.bochsrc # boot.bochsrc loads disk.img 12 13 # main: (address 0x8800) 14 -- cgit 1.4.1-2-gfad0