Recent content by dmarschal

  1. D

    Jumping into ARM assembly

    You can find better docs at linux-fbdev.org, like the HOWTO. On the mentioned ioctls. In short: they're like INT 10, AH=4F / VESA BIOS calls on an x86 system. There are two structures that hold information about the graphics hardware and its capabilities. -- fix screeninfo. (fb_fix_screeninfo...
  2. D

    Jumping into ARM assembly

    levi, #311 - correct. fbio_getvscreeninfo = 0x4600 fbio_putvscreeninfo = 0x4601 fbio_pandisplay = 0x4606 They're ioctl calls defined in fb.h and run by the kernel or the fb kernel module. The screensize can be calculated by multiplying BPP and YRES_VIRTUAL parameters from the virtual...
  3. D

    Jumping into ARM assembly

    Hello, I'm happy this thread is alive again. To help you I quickly put together an example that does the following: - framebuffer setup with double buffering - plots 2 pixels on the center of 2nd screen - scrolls the virtual screen from the 480th line to 0 Error checking was removed to shorten...
  4. D

    Jumping into ARM assembly

    fbp is the frame buffer pointer. it's the location where the display memory is mapped at. fbfd is framebuffer file descriptor. it's a file handle that points to '/dev/fb0/'.
  5. D

    Jumping into ARM assembly

    Here is a short piece of code that draws two pixels on the screen. I added comments and a new macro 'open' that should be added to macro.mac .macro open ffname,ffmode mov r0,pc @ PC points 2 instructions ahead, to the file name b 999f @...
  6. D

    Jumping into ARM assembly

    Do not use AND to work with a flag container. AND will clear other bits as well and sets ZERO flag to EQ or NZ if the whole register is 0 or 1. To manipulate/test bit(s) in a word use the following: set: ORR R9,#0b100 @ OR flip: EOR R9,#0b100 @ Exclusive OR, same a XOR on x86 clear...
  7. D

    Jumping into ARM assembly

    we can split the code into three parts 1/opening the event devices @ the usual init stuff goes here .title "evlist" .arm .include "macro.mac" ifpandora=1 @ i was writing this code on a zaurus. that's why it's here. .if ifpandora .else key_q=0x10 @ 'q' key scancode for...
  8. D

    Jumping into ARM assembly

    Sorry Linux-SWAT, you're going the wrong way. It's not event handling what you're doing in your code. I hope the next code will help you: .title "evlist" .arm .include "macro.mac" evdatalen=0x20 .data evdev: .ascii "/dev/input/event" evnum: .byte 0xff,0 evnamelen=.-evdev-1 .align .text...
  9. D

    Jumping into ARM assembly

    I hope this example will help you. To count the digits of a decimal number you have divide the number by 10 (and print out the remainder if you wish) until you get 0. .include "macro.mac" .globl _start printout =1 @ to print out the decimal number reversed count =1 @ to print out...
  10. D

    Jumping into ARM assembly

    yes, it does work. i've done it before with some gles code and it worked fine.
  11. D

    Jumping into ARM assembly

    you can _start your code in the .data section. here is an example: .include "macro.mac" .globl _start .data _start: print "hello\n" mov r4,#5 1: adr r1,toprintout mov r0,#console mov r2,#2 invoke sys_write ldrb r0,toprintout inc r0 strb r0,toprintout regloop r4,1b exit 0...
  12. D

    Jumping into ARM assembly

    I think the ARM procedure call standard assumes you're mixing C (or any other high level code) and ASM code. If you're writing pure ASM code then you don't have to follow this rule. Just preserve what you need. GCC can optimize your register usage when the ASM code is inlined so you don't have...
  13. D

    Jumping into ARM assembly

    Levi: >> I'm not familiar with the ! used in dmarshall's 'STMDB sp!,...' though.  That's new syntax to me The "!" means the new SP (after store) is written back to SP. If you leave it out, like STMDB SP,{R4,R5} then SP will point to the same address as before and another call may destroy your...
  14. D

    Jumping into ARM assembly

    Here is how LDM/STM works: LDMIA - LDM Increment After LDMDA - LDM Decrement After LDMIB - LDM Increment Before LDMDB - LDM Decrement Before x86 PUSH = ARM STMDB x86 POP = ARM LDMIA To see how segments are allocated under Linux I created a short example.   .include "macro.mac" .globl _start...
  15. D

    Jumping into ARM assembly

    printhex: stmdb sp!, {r0-r3,r7,lr} @ save regs mov r2,#7 @ print out 8 numbers sub sp,sp,#8 @ make room for the ascii string on stack 1: and r3,r0,#0xf @ pick the lower nibble 0..f mov r0,r0, ror #4 @ get the next nibble cmp r3,#0xa...
Back
Top