{"id":13830982,"url":"https://github.com/freem/asm6f","last_synced_at":"2025-04-06T06:14:18.757Z","repository":{"id":12486395,"uuid":"15155751","full_name":"freem/asm6f","owner":"freem","description":"A fork of loopy's ASM6, a 6502 assembler.","archived":false,"fork":false,"pushed_at":"2025-01-27T17:36:50.000Z","size":322,"stargazers_count":99,"open_issues_count":16,"forks_count":26,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T05:09:17.503Z","etag":null,"topics":["6502","assembler","famicom","nes"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/freem.png","metadata":{"files":{"readme":"readme-original.txt","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-12-13T05:40:13.000Z","updated_at":"2025-03-23T13:30:48.000Z","dependencies_parsed_at":"2025-02-16T19:43:11.778Z","dependency_job_id":null,"html_url":"https://github.com/freem/asm6f","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freem%2Fasm6f","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freem%2Fasm6f/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freem%2Fasm6f/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freem%2Fasm6f/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freem","download_url":"https://codeload.github.com/freem/asm6f/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441063,"owners_count":20939239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["6502","assembler","famicom","nes"],"created_at":"2024-08-04T10:01:14.457Z","updated_at":"2025-04-06T06:14:18.727Z","avatar_url":"https://github.com/freem.png","language":"C","readme":"--------------------------------------------------------------\nASM6 (v1.6)\nA 6502 assembler by loopy (loopy at mm.st)\n--------------------------------------------------------------\n\nYes, it's another 6502 assembler.  I built it to do NES development, but you\ncan probably use it for just about anything.  Why use this instead of one of\nthe other zillion assemblers out there?  I don't know, but choice is good,\nright? :)  I wrote it because I thought most others were either too finicky,\nhad weird syntax, took too much work to set up, or too bug-ridden to be useful.\n\nThis is free software.  You may use, modify, and / or redistribute any part\nof this software in any fashion.\n\n--------------------------------------------------------------\nCommand line\n--------------------------------------------------------------\n\nUsage:\n\n        asm6 [-options] sourcefile [outputfile] [listfile]\n\nOptions:\n\n        -?         Show some help\n        -l         Create listing\n        -L         Create verbose listing (expand REPT, MACRO)\n        -d\u003cname\u003e:  Define a symbol and make it equal to 1\n\t-q         Quiet mode (suppress all output unless there's an error)\n        Default output is \u003csourcefile\u003e.bin\n        Default listing is \u003csourcefile\u003e.lst\n\n--------------------------------------------------------------\nSyntax\n--------------------------------------------------------------\n\nComments begin with a semicolon (;).  A colon (:) following a label is\noptional.\n\n    examples:\n\n        lda #$00             ;hi there\n        label1: jmp label2\n        label2  beq label1\n\n--------------------------------------------------------------\nNumbers and expressions\n--------------------------------------------------------------\n\nHexadecimal numbers begin with '$' or end with 'h'.  Binary numbers begin\nwith '%' or end with 'b'.  Characters and strings are surrounded by\nsingle or double quotes.  The characters (' \" \\) within quotes must be\npreceded by a backslash (\\).\n\n    examples:\n\n        12345\n        '12345'\n        $ABCD\n        0ABCDh\n        %01010101\n        01010101b\n\nSupported operators (listed by precedence):\n\n          ( )\n (unary)  + - ~ ! \u003c \u003e\n          * / %\n          + -\n          \u003c\u003c \u003e\u003e\n          \u003c \u003e \u003c= \u003e=\n          = == != \u003c\u003e \n          \u0026\n          ^\n          |\n          \u0026\u0026\n          ||\n\n'=' and '\u003c\u003e' are equivalent to C's '==' and '!=' operators.  The unary '\u003c'\nand '\u003e' operators give the lower and upper byte of a 16-bit word (respectively).\nAll other operators function like their C equivalents.\n\n--------------------------------------------------------------\nLabels\n--------------------------------------------------------------\n\nLabels are case sensitive.  The special '$' label holds the current program\naddress.  Labels beginning with '@' are local labels. They have limited scope,\nvisible only between non-local labels.  Names of local labels may be reused.\n\n        label1:\n          @tmp1:\n          @tmp2:\n        label2:\n          @tmp1:\n          @tmp2:\n\nLabels beginning with one or more '+' or '-' characters are nameless labels,\nespecially useful for forward and reverse branches.\n\n    example:\n\n      --  ldx #0\n       -  lda $2002 ;loop (wait for vblank)\n          bne -\n       -  lda $2002 ;nameless labels are easy to reuse..\n          bne -\n\n          cpx #69\n          beq +     ;forward branch..\n          cpx #96\n          beq +here ;use more characters to make more unique\n\n          jmp --    ;multiple --'s handy for nested loops\n       +  ldx #0\n   +here  nop\n\n--------------------------------------------------------------\nAssembler directives (in no particular order)\n--------------------------------------------------------------\n\nAll directives are case insensitive and can also be preceded by a period (.)\n\n\nEQU\n\n        For literal string replacement, similar to #define in C.\n\n                one EQU 1\n                plus EQU +\n                DB one plus one ;DB 1 + 1\n\n=\n\n        Unlike EQU, statements with '=' are evaluated to a number first.\n        Also unlike EQU, symbols created with '=' can be reused.\n\n                i=1\n                j EQU i+1\n                k=i+1   ;k=1+1\n                i=j+1   ;i=i+1+1\n                i=k+1   ;i=2+1\n\nINCLUDE (also INCSRC)\n\n        Assemble another source file as if it were part of the current\n        source.\n\n                INCLUDE whatever.asm\n\nINCBIN (also BIN)\n\n        Add the contents of a file to the assembly output.\n\n                moredata: INCBIN whatever.bin\n\n\tAn optional file offset and size can be specified.\n\n\t\tINCBIN foo.bin, $400\t\t;read foo.bin from $400 to EOF\n\t\tINCBIN foo.bin, $200, $2000\t;read $2000 bytes, starting from $200\n\nDB, DW (also BYTE/WORD, DCB/DCW, DC.B/DC.W)\n\n        Emit byte(s) or word(s).  Multiple arguments are separated by\n        commas.  Strings can be \"shifted\" by adding a value to them (see\n        example).\n\n                DB $01,$02,$04,$08\n                DB \"ABCDE\"+1          ;equivalent to DB \"BCDEF\"\n                DB \"ABCDE\"-\"A\"+32     ;equivalent to DB 32,33,34,35,36\n\nDL, DH\n\n        Similar to DB, outputting only the LSB or MSB of a value.\n\n                DL a,b,c,d            ;equivalent to DB \u003ca, \u003cb, \u003cc, \u003cd\n                DH a,b,c,d            ;equivalent to DB \u003ea, \u003eb, \u003ec, \u003ed\n\nHEX\n\n        Compact way of laying out a table of hex values.  Only raw hex values\n        are allowed, no expressions.  Spaces can be used to separate numbers.\n\n                HEX 456789ABCDEF  ;equivalent to DB $45,$67,$89,$AB,$CD,$EF\n                HEX 0 1 23 4567   ;equivalent to DB $00,$01,$23,$45,$67\n\nDSB, DSW (also DS.B/DS.W)\n\n        Define storage (bytes or words).  The size argument may be followed\n        by a fill value (default filler is 0).\n\n                DSB 4         ;equivalent to DB 0,0,0,0\n                DSB 8,1       ;equivalent to DB 1,1,1,1,1,1,1,1\n                DSW 4,$ABCD   ;equivalent to DW $ABCD,$ABCD,$ABCD,$ABCD\n\nPAD\n\n        Fill memory from the current address to a specified address.  A fill\n        value may also be specified.\n\n                PAD $FFFA     ;equivalent to DSB $FFFA-$\n                PAD $FFFA,$EA ;equivalent to DSB $FFFA-$,$EA\n\nORG\n\n        Set the starting address if it hasn't been assigned yet, otherwise\n        ORG functions like PAD.\n\n                ORG $E000     ;start assembling at $E000\n                .\n                .\n                .\n                ORG $FFFA,$80 ;equivalent to PAD $FFFA,$80\n\nALIGN\n\n        Fill memory from the current address to an N byte boundary.  A fill\n        value may also be specified.\n\n                ALIGN 256,$EA\n\nFILLVALUE\n\n        Change the default filler for PAD, ALIGN, etc.\n\n                FILLVALUE $FF\n\nBASE\n\n        Set the program address.  This is useful for relocatable code,\n        multiple code banks, etc.  The same can also be accomplished by\n        assigning the '$' symbol directly (i.e. '$=9999').\n\n                oldaddr=$\n                BASE $6000\n                stuff:\n                    .\n                    .\n                    .\n                BASE oldaddr+$-stuff\n\nIF / ELSEIF / ELSE / ENDIF\n\n        Process a block of code if an expression is true (nonzero).\n\n                IF j\u003e0\n                    DB i/j\n                ELSE\n                    DB 0\n                ENDIF\n\nIFDEF / IFNDEF\n\n        Process a block of code if a symbol has been defined / not defined.\n\n                IFDEF _DEBUG_\n                    .\n                    .\n                    .\n                ENDIF\n\nMACRO / ENDM\n\n        MACRO name args...\n\n        Define a macro.  Macro arguments are comma separated.\n        Labels defined inside macros are local (visible only to that macro).\n\n                MACRO setAXY x,y,z\n                    LDA #x\n                    LDX #y\n                    LDY #z\n                ENDM\n\n                setAXY $12,$34,$56\n                        ;expands to LDA #$12\n                        ;           LDX #$34\n                        ;           LDY #$56\n\nREPT / ENDR\n\n        Repeat a block of code a specified number of times.\n        Labels defined inside REPT are local.\n\n                i=0\n                REPT 256\n                    DB i\n                    i=i+1\n                ENDR\n\nENUM / ENDE\n\n        Reassign PC and suppress assembly output.  Useful for defining\n        variables in RAM.\n\n                ENUM $200\n                foo:    db 0\n                foo2:   db 0\n                ENDE\n\nERROR\n\n        Stop assembly and display a message.\n\n                IF x\u003e100\n                        ERROR \"X is out of range :(\"\n                ENDIF\n\n        \n--------------------------------------------------------------\n\u003cEOF\u003e","funding_links":[],"categories":["C","Development Tools"],"sub_categories":["Assemblers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreem%2Fasm6f","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreem%2Fasm6f","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreem%2Fasm6f/lists"}