MCPcopy Create free account
hub / github.com/GamerHack/GamerHack.github.io / Addr

Class Addr

g2all/700/module/mem.js:43–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43export class Addr extends Int {
44 read8(offset) {
45 const m = mem;
46 if (isInteger(offset) && 0 <= offset && offset <= 0xffffffff) {
47 m._set_addr_direct(this);
48 } else {
49 add_and_set_addr(m, offset, this.lo, this.hi);
50 offset = 0;
51 }
52
53 return m.read8_at(offset);
54 }
55
56 read16(offset) {
57 const m = mem;
58 if (isInteger(offset) && 0 <= offset && offset <= 0xffffffff) {
59 m._set_addr_direct(this);
60 } else {
61 add_and_set_addr(m, offset, this.lo, this.hi);
62 offset = 0;
63 }
64
65 return m.read16_at(offset);
66 }
67
68 read32(offset) {
69 const m = mem;
70 if (isInteger(offset) && 0 <= offset && offset <= 0xffffffff) {
71 m._set_addr_direct(this);
72 } else {
73 add_and_set_addr(m, offset, this.lo, this.hi);
74 offset = 0;
75 }
76
77 return m.read32_at(offset);
78 }
79
80 read64(offset) {
81 const m = mem;
82 if (isInteger(offset) && 0 <= offset && offset <= 0xffffffff) {
83 m._set_addr_direct(this);
84 } else {
85 add_and_set_addr(m, offset, this.lo, this.hi);
86 offset = 0;
87 }
88
89 return m.read64_at(offset);
90 }
91
92 readp(offset) {
93 const m = mem;
94 if (isInteger(offset) && 0 <= offset && offset <= 0xffffffff) {
95 m._set_addr_direct(this);
96 } else {
97 add_and_set_addr(m, offset, this.lo, this.hi);
98 offset = 0;
99 }
100

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected