summary refs log tree commit diff stats
path: root/examples
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2016-06-02 17:50:09 +0200
committerhut <hut@lepus.uberspace.de>2016-06-02 17:50:09 +0200
commit24712b901b6f5a02038e5c8b892c1ec63085cca9 (patch)
tree849b13ac60537facebe8e0a241bfdc7a7c438ac8 /examples
parentea355f491fb10d5ce054c7813d9abdfd3fc68991 (diff)
downloadranger-24712b901b6f5a02038e5c8b892c1ec63085cca9.tar.gz
examples/plugin_new_macro.py: fix spaces
Diffstat (limited to 'examples')
-rw-r--r--examples/plugin_new_macro.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/plugin_new_macro.py b/examples/plugin_new_macro.py
index 6757e491..31350387 100644
--- a/examples/plugin_new_macro.py
+++ b/examples/plugin_new_macro.py
@@ -11,9 +11,9 @@ old_get_macros = ranger.core.actions.Actions._get_macros
 # Define a new macro function
 import time
 def get_macros_with_date(self):
-       macros = old_get_macros(self)
-       macros['date'] = time.strftime('%m/%d/%Y')
-       return macros
+    macros = old_get_macros(self)
+    macros['date'] = time.strftime('%m/%d/%Y')
+    return macros
 
 # Overwrite the old one
 ranger.core.actions.Actions._get_macros = get_macros_with_date
kartik.com> 2020-12-28 00:12:06 -0800 committer Kartik Agaram <vc@akkartik.com> 2020-12-28 00:12:06 -0800 7437 - baremetal: draw pixel on keyboard event' href='/akkartik/mu/commit/baremetal/ex3.hex?h=hlt&id=437fa654cbba0f29c0a73754803aa00404f0f3a2'>437fa654 ^
8be561f5 ^
437fa654 ^


8be561f5 ^
437fa654 ^











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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

                                                                        








                                                                                
                                                                  
 
                         



                                                       
                              







                                                            
                                 












                                                                 
                                 


                                                           
                                 











                                                
# Draw pixels in response to keyboard events, starting from the top-left
# and in raster order.
#
# 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/ex3.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

# main:  (address 0x9000)

# eax <- LFB
8b  # copy *rm32 to r32
  05  # 00/mod/indirect 000/r32/eax 101/rm32/use-disp32
  28 81 00 00 # disp32 [label]

# var read index/ecx: byte = 0
31 c9  # ecx <- xor ecx;  11/direct 001/r32/ecx 001/rm32/ecx

# $loop:
  # CL = *read index
  8a  # copy m8 at r32 to r8
    0d  # 00/mod/indirect 001/r8/cl 101/rm32/use-disp32
    cc 7d 00 00  # disp32 [label]
  # CL = *(keyboard buffer + ecx)
  8a  # copy m8 at r32 to r8
    89  # 10/mod/*+disp32 001/r8/cl 001/rm32/ecx
    d0 7d 00 00  # disp32 [label]
  # if (CL == 0) loop (spin loop)
  80
    f9  # 11/mod/direct 111/subop/compare 001/rm8/CL
    00  # imm8
  74 ef  # loop -17 [label]
# offset 0x19:
  # otherwise increment read index
  fe  # increment byte
    05  # 00/mod/indirect 000/subop/increment 101/rm32/use-disp32
    cc 7d 00 00  # disp32 [label]
  # clear top nibble of index (keyboard buffer is circular)
  80  # and byte
    25  # 00/mod/indirect 100/subop/and 101/rm32/use-disp32
    cc 7d 00 00  # disp32 [label]
    0f  # imm8
  # print a pixel in fluorescent green
  c6  # copy imm8 to m8 at rm32
    00  # 00/mod/indirect 000/subop 000/rm32/eax
    31  # imm32
  40  # increment eax
  eb dc # loop -36 [label]

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

# vim:ft=subx