about summary refs log tree commit diff stats
path: root/html/apps/ex1.subx.html
Commit message (Expand)AuthorAgeFilesLines
* 7476Kartik Agaram2020-12-301-1/+1
* 6513Kartik Agaram2020-06-121-1/+1
* 6091Kartik Agaram2020-03-061-2/+2
* 5875Kartik Agaram2020-01-021-3/+3
* 5856Kartik Agaram2020-01-011-0/+77
rtik Agaram <vc@akkartik.com> 2020-12-26 22:01:45 -0800 7417 - baremetal: drawing on LFB in Bochs' href='/akkartik/mu/commit/baremetal/ex2.hex?h=hlt&id=0243ee4e834e4118e3c2eadc68d36f8e62d94d28'>0243ee4e ^
796f3b70 ^
562476d7 ^


73728ec6 ^
fa0e67c1 ^
9ef034fd ^



ca5ac515 ^
9ef034fd ^
5095021f ^
9ef034fd ^

5095021f ^
9ef034fd ^
73728ec6 ^
9ef034fd ^


5d2f1c57 ^
3a671402 ^


73728ec6 ^
5d2f1c57 ^
73728ec6 ^




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
                                                               


                                                                        
                                     



                                                                                
     
                                                                  


                      
 
                         



                                                       
                              
 
                                     

                                                
                       
 
        


                                              
                           


                                              
                   
                                 




                                   
# Test out the video mode by filling in the screen with pixels.
#
# To run, first prepare a realistically sized disk image:
#   dd if=/dev/zero of=disk.img count=20160  # 512-byte sectors, so 10MB
# Load the program on the disk image:
#   cat baremetal/boot.hex baremetal/ex2.hex  |./bootstrap run apps/hex  > a.bin
#   dd if=a.bin of=disk.img conv=notrunc
# To run:
#   qemu-system-i386 disk.img
# Or:
#   bochs -f baremetal/boot.bochsrc  # boot.bochsrc loads disk.img
#
# Expected output:
#   html/baremetal.png

# main:  (address 0x9400)

# ecx <- LFB
8b  # copy *rm32 to r32
  0d  # 00/mod/indirect 001/r32/ecx 101/rm32/use-disp32
  28 81 00 00 # disp32 [label]

# eax <- LFB + 0xbffff (1024*768 - 1)
8d  # copy-address rm32 to r32
  81  # 10/mod/*+disp32 000/r32/eax 001/rm32/ecx
  ff ff 0b 00  # disp32

# $loop:
# if (eax < ecx) break
39  # compare rm32 with r32
  c8  # 11/mod/direct 001/r32/ecx 000/rm32/eax
7c 05  # break if < [label]
# *eax <- al
88  # copy r8 to m8 at r32
  00  # 00/mod/indirect 000/r8/AL 000/rm32/eax
48  # decrement eax
eb f7  # loop to -9 bytes [label]

# $break:
e9 fb ff ff ff  # hang indefinitely

# vim:ft=subx