This project is read-only.

x86 Assembly help (Solved)

Topics: Off Topic, Other
Oct 2, 2012 at 1:16 AM
Edited Oct 2, 2012 at 1:44 AM

Nevermind, I figured it out! Thanks though.

Oct 2, 2012 at 8:10 AM
mov eax, Var2

This normally means copying the Address of Var2 (0x2000xx value) to eax

mov ax, [Var2]

this means copying a 16-bit value at the location as specified by Var2 (location 0x2000xx in memory) to ax


On Tue, Oct 2, 2012 at 2:16 AM, civilwarrock <notifications@codeplex.com> wrote:

From: civilwarrock

Hey guys, Kudzu or mterwoord. I need some help with this. I have spent three days on this, I studied Cosmos's output, and read tons of examples, books, tutorials and for some reason I have found nothing on this. I even read a Nasm Manual! Ok, so here's the code

%ifndef ELF_COMPILATION
use32
org 0x200000
[map all main.map]
%endif
section .data
%ifndef ELF_COMPILATION
MultibootSignature dd 464367618
MultibootFlags dd 65539
MultibootChecksum dd -464433157
MultibootHeaderAddr dd MultibootSignature
MultibootLoadAddr dd MultibootSignature
MultibootLoadEndAddr dd EndCode
MultibootBSSEndAddr dd EndCode
MultibootEntryAddr dd START
%endif
%ifdef ELF_COMPILATION
MultibootSignature dd 464367618
MultibootFlags dd 3
MultibootChecksum dd -464367621
%endif
MultibootGraphicsRuntime_VbeModeInfoAddr dd 2147483647
MultibootGraphicsRuntime_VbeControlInfoAddr dd 2147483647
MultibootGraphicsRuntime_VbeMode dd 2147483647
MultiBootInfo_Memory_High dd 0
MultiBootInfo_Memory_Low dd 0
Var2: db 104
section .text
jmp START
START:
	;Print out letter out.
    call DisplayMessage
	jmp Halt
DisplayMessage:
	mov ax, Var2
	mov [0xB8000], ax
	ret
Halt:
	jmp Halt
EndCode:
It runs in protected mode, and uses Syslinux, just like what you guys are doing.
Now I would like to move Var2's 104 value to 0xB8000, and one way I thought about doing
it was to move Var2 to ax, and then move ax to 0xB8000, but that doesn't work
as I think it's moving Var2's memory location, or pointer in otherwords.
So how do I extract the value out of a Variable? In this case the 104 inside of Var2.
Thanks guys, I spent tons of time on this, and this is driving me crazy that it's
not working! Thanks, - Matt :)

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com