GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — emu6502/opcode_gen.go at main · univta0001/emu6502 Expand file tree/ Copy pathopcode_gen.goMore file actions 55 lines (46 loc) · 1.25 KB / Copy pathopcode_gen.goFile metadata and controls55 lines (46 loc) · 1.25 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 package main import ( "encoding/json" "fmt" "io/ioutil" ) // Opcode6502 defines the 6502 opcodes type Opcode6502 struct { Name string `json:"name"` Description string `json:"description"` Flags Flags6502 `json:"flags"` AddressMode []AddrMode6502 `json:"addressingModes"` Type string `json:"type"` Expression string `json:"expression"` Assignee string `json:"assignee"` } // Flags6502 defines flags in 6502 type Flags6502 struct { Overflow int `json:"overflow,omitempty"` Carry int `json:"carry,omitempty"` Zero int `json:"zero,omitempty"` Negative int `json:"negative,omitempty"` Decimal int `json:"decimal,omitempty"` Interrupt int `json:"interrupt,omitempty"` } // AddrMode6502 defines addressing mode in 6502 type AddrMode6502 struct { Opcode string `json:"opcode"` Cycles int `json:"cycles"` Mode int `json:"mode"` CycleModifier int `"cycleModifier"` } func check(e error) { if e != nil { panic(e) } } func main() { data, err := ioutil.ReadFile("6502.json") check(err) var response []Opcode6502 json.Unmarshal(data, &response) for _, opcode := range response { fmt.Printf("%s - %s\n", opcode.Name, opcode.Description) } } |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |