Skip to content

Instantly share code, notes, and snippets.

@mepcotterell
Created February 7, 2019 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mepcotterell/ed8eb202de1ce5d252db05b3ba0ebea9 to your computer and use it in GitHub Desktop.
Save mepcotterell/ed8eb202de1ce5d252db05b3ba0ebea9 to your computer and use it in GitHub Desktop.

main.s

	.text
	.globl main
	.type main, @function
main:
	pushq 	%rbp		;
	movq	%rsp, %rbp	;
	pushq	%rbx		;

	movq	$0xFFFFFFFFFFFFFFFF, %rbx ;
	movq	$0, %rcx	;	
	movb	%bl, %ch		  ;
	
	movq	$0, %rcx	;
	movw	%bx, %cx		  ;

	movq	$0, %rcx	;	
	movl	%ebx, %ecx		  ;

	movq	$0, %rcx	;	
	movq	%rbx, %rcx		  ;

	movq	$0xFFFFFFFFFFFFFFFF, %rax ; // FFFF FFFF FFFF FFFF rax	
	movb	$0, %al                   ; // FFFF FFFF FFFF FF00 rax
	movw	$0, %ax                   ; // FFFF FFFF FFFF 0000 rax
	movl	$0, %eax                  ; // 0000 0000 0000 0000 rax	
	
	xorq	%rax, %rax	;

	popq	%rbx		;
	movq	%rbp, %rsp	;
	popq 	%rbp		;
	ret			;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment