Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › Annoying Assembler Problem <solved>
New Posts  All Forums:Forum Nav:

Annoying Assembler Problem <solved>

post #1 of 4
Thread Starter 
Code:

.data
        testtext:
                .asciz "XXXXXX"  

.bss

.text

.globl _start

.start:
movl $4, %eax
movl $1, %ebx
movl $testtext, %ecx
movl $7, %esi

int $0x80

movl $1, %eax
movl $37, %ebx
int $0x80



Hi guys and girls, hope you are all well and in the firday feeling smile.gif


I was wondering if a better person than me could help redface.gif


In the abouve program its ment to be a hello world thing for my assembler course, its stumped me and my lecturer why print isnt working and any help as to why it isnt printing to the screen will be hugley helped

Its being compiled on a 64 bit machine debian 6
Linux innes 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 GNU/Linux

# ~ /source/ctec3751/lab2$ as prog3.s -o prog3.o --32 -ggdb; ld prog3.o -o prog3.exe -m elf_i386;
#~/source/ctec3751/lab2$ ./prog3.exe

Looking in gdb i can see the regiers being set, but it just skips over the write as if it has not been called frown.gif


~~~~~~~~~~~~~
EDIT :-

We were told to use esi when in fact we should have been using EDX

~~~~~~~~#



Thank you for taking the time to read this smile.gif
Edited by Ulquiorra - 10/19/12 at 5:45am
Supercomputer ^_^
(13 items)
 
  
CPUMotherboardGraphicsRAM
1055T M4A88T-D EVO USB3 ATI 6850 4 GB 
Optical DriveOSMonitorKeyboard
DVD RW Windows 8 Pro lp1900 + 2 X 15 inch dell Microsoft Comfort Curve 
PowerCase
600watt thermaltake antec 200 
  hide details  
Reply
Supercomputer ^_^
(13 items)
 
  
CPUMotherboardGraphicsRAM
1055T M4A88T-D EVO USB3 ATI 6850 4 GB 
Optical DriveOSMonitorKeyboard
DVD RW Windows 8 Pro lp1900 + 2 X 15 inch dell Microsoft Comfort Curve 
PowerCase
600watt thermaltake antec 200 
  hide details  
Reply
post #2 of 4
I can't say anything for the sintax and I'm used to intel's NASM.

But shouldn't the text length be stored on edx?

also, I would get the length using equ in .data, like

text_len: equ $-testtext

and then

movl $text_len, %edx


see what happens when you also call the interruption more than once.
If it's not a sintax/logic error, I would say that the interruption 0x80 has been reprogrammed in your OS or for some reason the archive descriptor isn't your screen.


Also, on
.globl _start

.start:

shouldn't it be

.globAl _start
_start?
    
CPUMotherboardGraphicsRAM
i5 750 @ 3.6 P7P55 EVO ASUS 5870 V2 @950/1250 8gb @1600 cas 9 @1.5v 
Hard DriveOptical DriveCoolingOS
crucial m4 256gb + 3tb seagate none venomous-X + 2 P/P yate loons @5v 8 pro x64 + mint 14 cinnamon x32 
MonitorKeyboardPowerCase
PX2370 random Antec HPC-850 BX-500 aerocool 
MouseMouse PadAudio
CM Storm Spawn QcK+ Shure SRH 750DJ+FiiO E5 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
i5 750 @ 3.6 P7P55 EVO ASUS 5870 V2 @950/1250 8gb @1600 cas 9 @1.5v 
Hard DriveOptical DriveCoolingOS
crucial m4 256gb + 3tb seagate none venomous-X + 2 P/P yate loons @5v 8 pro x64 + mint 14 cinnamon x32 
MonitorKeyboardPowerCase
PX2370 random Antec HPC-850 BX-500 aerocool 
MouseMouse PadAudio
CM Storm Spawn QcK+ Shure SRH 750DJ+FiiO E5 
  hide details  
Reply
post #3 of 4
So, what happened?
    
CPUMotherboardGraphicsRAM
i5 750 @ 3.6 P7P55 EVO ASUS 5870 V2 @950/1250 8gb @1600 cas 9 @1.5v 
Hard DriveOptical DriveCoolingOS
crucial m4 256gb + 3tb seagate none venomous-X + 2 P/P yate loons @5v 8 pro x64 + mint 14 cinnamon x32 
MonitorKeyboardPowerCase
PX2370 random Antec HPC-850 BX-500 aerocool 
MouseMouse PadAudio
CM Storm Spawn QcK+ Shure SRH 750DJ+FiiO E5 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
i5 750 @ 3.6 P7P55 EVO ASUS 5870 V2 @950/1250 8gb @1600 cas 9 @1.5v 
Hard DriveOptical DriveCoolingOS
crucial m4 256gb + 3tb seagate none venomous-X + 2 P/P yate loons @5v 8 pro x64 + mint 14 cinnamon x32 
MonitorKeyboardPowerCase
PX2370 random Antec HPC-850 BX-500 aerocool 
MouseMouse PadAudio
CM Storm Spawn QcK+ Shure SRH 750DJ+FiiO E5 
  hide details  
Reply
post #4 of 4
Thread Starter 
Sorry we only have access to the computers we used in the labs once a week ... woo sepearte computers ¬_¬


Anyways the problem was as you suggested that EDX should have been used rather then ESI, what chance have we got when the lecture teaches us wrong tongue.gif


Thanks thumb.gif
Supercomputer ^_^
(13 items)
 
  
CPUMotherboardGraphicsRAM
1055T M4A88T-D EVO USB3 ATI 6850 4 GB 
Optical DriveOSMonitorKeyboard
DVD RW Windows 8 Pro lp1900 + 2 X 15 inch dell Microsoft Comfort Curve 
PowerCase
600watt thermaltake antec 200 
  hide details  
Reply
Supercomputer ^_^
(13 items)
 
  
CPUMotherboardGraphicsRAM
1055T M4A88T-D EVO USB3 ATI 6850 4 GB 
Optical DriveOSMonitorKeyboard
DVD RW Windows 8 Pro lp1900 + 2 X 15 inch dell Microsoft Comfort Curve 
PowerCase
600watt thermaltake antec 200 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › Annoying Assembler Problem <solved>