SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
CASL2 ࣮ߦ‫঺ڥ؀‬հ
Feb 9 2021 / asuka y
COMET2 Emulator ࡞ͬͯΈͨ
‫ܦ‬Ң
ੵಡ stack
ࣗ࡞ΤϛϡϨʔλͰֶͿx86ΞʔΩςΫνϟ
ISBN 978-4-8399-5474-1
30೔ͰͰ͖Δ! OSࣗ࡞ೖ໳
ISBN 978-4-8399-1984-9
ࢼ͠ʹɺ
Կ͔؆୯ͳΤϛϡϨʔλ
Λ࣮૷͍ͨ͠ɻ
RustͰ࣮૷
୊ࡐʹ CASL2/COMET2 ͱ͔ྑͦ͞͏
COMET2/CASL2ͱ͸
COMET2
> COMET2༻ͷԾ૝ΞηϯϒϦ
> NASMʹࣅͨ‫ه‬๏
> 36໋ྩͱগͳ͘γϯϓϧ
CASL2
> 16bitsͷԾ૝ίϯϐϡʔλ
> 1‫ͨ·ޠ‬͸2‫ޠ‬ͷCISCϓϩηοα
IPA : ࢼ‫͢༻࢖Ͱݧ‬Δ৘ใٕज़ʹؔ͢Δ༻‫ޠ‬ɾϓϩάϥϜ‫Ͳͳޠݴ‬ Ver.4.2 > Ξηϯϒϥ‫ޠݴ‬ͷ࢓༷
https://www.jitec.ipa.go.jp/1_13download/shiken_yougo_ver4_2.pdf
σϞ
https://a-skua.github.io/tiamat/
ઃ‫ܭ‬
MAIN START
LAD GR1,0 ; var start = 0
LAD GR0,63 ; var end = 63
XOR GR2,GR2 ; var fizz_count = 0
XOR GR3,GR3 ; var buzz_count = 0
XOR GR4,GR4 ; var fizz_buzz_cout = 0
LAD GR5,3 ; final fizz = 3
LAD GR6,5 ; final buzz = 5
LAD GR7,15 ; final fizz_buzz = 15
; for (var i = start; i < end; i++)
LOOP CPL GR1,GR0
JZE EXIT
LAD GR1,1,GR1
LAD GR2,1,GR2 ; fizz_count += 1
LAD GR3,1,GR3 ; buzz_count += 1
LAD GR4,1,GR4 ; fizz_buzz_count += 1
CPL GR4,GR7 ; if (fizz_buzz_count == 15)
JZE FZBZ
CPL GR3,GR6 ; if (buzz_count == 5)
JZE BZ
CPL GR2,GR5 ; IF (fizz_count == 3)
JZE FZ
OUT DOT,255
JUMP LOOP
FZBZ OUT FIZZ,255
LAD GR4,0
Hello, world.
INPUT OUTPUT
ઃ‫ܭ‬
MAIN START
LAD GR1,0 ; var start = 0
LAD GR0,63 ; var end = 63
XOR GR2,GR2 ; var fizz_count = 0
XOR GR3,GR3 ; var buzz_count = 0
XOR GR4,GR4 ; var fizz_buzz_cout = 0
LAD GR5,3 ; final fizz = 3
LAD GR6,5 ; final buzz = 5
LAD GR7,15 ; final fizz_buzz = 15
; for (var i = start; i < end; i++)
LOOP CPL GR1,GR0
JZE EXIT
LAD GR1,1,GR1
LAD GR2,1,GR2 ; fizz_count += 1
LAD GR3,1,GR3 ; buzz_count += 1
LAD GR4,1,GR4 ; fizz_buzz_count += 1
CPL GR4,GR7 ; if (fizz_buzz_count == 15)
JZE FZBZ
CPL GR3,GR6 ; if (buzz_count == 5)
JZE BZ
CPL GR2,GR5 ; IF (fizz_count == 3)
JZE FZ
OUT DOT,255
JUMP LOOP
FZBZ OUT FIZZ,255
LAD GR4,0
Hello, world.
INPUT OUTPUT
ೖྗΛஞ࣍ղऍͯ͠ग़ྗ͢Δํ๏ͰΤϛϡϨʔλΛ࣮૷͠Α͏ͱͯ͠‫׬‬੒ͤͣ
‫ݪ‬Ҽ
͍͘ΒΞηϯϒϦͷ໋ྩ͕‫ػ‬ց‫ޠ‬
ͷ໋ྩͱ1 : 1ͱ͸͍͑ɺೖྗˠग़ྗ
ͷม‫׵‬΋ৗʹ1 : 1Ͱ͸ͳ͍ɻ
LOAD໋ྩ
• LD GR1,GR0 var x = y
• LD GR1,0 var x = 0
• LD GR1,1,GR1 x += 1
if instruction equal load:
if operand match pattern1:
// any…
else if operand match pattern2:
// any…
else if operand match pattern3:
// any…
࠶ઃ‫ܭ‬
MAIN START
LAD GR1,0 ; var start = 0
LAD GR0,63 ; var end = 63
XOR GR2,GR2 ; var fizz_count = 0
XOR GR3,GR3 ; var buzz_count = 0
XOR GR4,GR4 ; var fizz_buzz_cout = 0
LAD GR5,3 ; final fizz = 3
LAD GR6,5 ; final buzz = 5
LAD GR7,15 ; final fizz_buzz = 15
; for (var i = start; i < end; i++)
LOOP CPL GR1,GR0
JZE EXIT
LAD GR1,1,GR1
LAD GR2,1,GR2 ; fizz_count += 1
LAD GR3,1,GR3 ; buzz_count += 1
LAD GR4,1,GR4 ; fizz_buzz_count += 1
CPL GR4,GR7 ; if (fizz_buzz_count == 15)
JZE FZBZ
CPL GR3,GR6 ; if (buzz_count == 5)
JZE BZ
CPL GR2,GR5 ; IF (fizz_count == 3)
JZE FZ
OUT DOT,255
JUMP LOOP
FZBZ OUT FIZZ,255
LAD GR4,0
Hello, world.
INPUT OUTPUT
1ͭͷॲཧʹશͯΛ࣮૷ͤͣɺ‫ػ‬ೳຖʹ࣮૷ͯ͠૊Έ߹ΘͤΔ͜ͱͰ࣮‫ݱ‬
ղऍ ม‫׵‬ ࣮ߦ
࠶ઃ‫ܭ‬
GR0: 21
COMET2
࣮ߦ‫ڥ؀‬
໋ྩ
Ϩδελ/ϝϞϦ
0x1000 0x0007
0x1210 0x0001
0x2001 0x0007
0x8100
0x000A 0x000B
CASL2
ղੳ‫ث‬
MAIN START
LD GR0,VAL
LAD GR1,1
ADDA GR0,VAL,GR1
RET
VAL DC 10,11
END
ղऍɾม‫׵‬ ࣮ߦ
> ςετ͕ॻ͖΍͍͢
• ೖྗ஋ʹཚ਺Λ༻͍ͨςετ
> ࣮૷͕༰қʹ
• ίʔυͷ੹೚ൣғ͕໌֬
> εςʔτϨεͳ࣮૷
• ঢ়ଶ͸֎͔Β༩͑ΒΕΔ
> ೖྗʹରͯ͠Ұҙͳग़ྗʹ͢Δ
• ࣮ߦ݁Ռ͕ਪଌ͠΍͘͢ͳΔ
ҙ͍ࣝͯ͠Δ͜ͱ
void noOperation(final Resource r) {
final pr = r.programRegister;
pr.value += 1;
}
final casl2 = Casl2();
final comet2 = Comet2();
final code = casl2.compile(asm);
comet2.load(code);
comet2.exec();
࣮૷‫ޠݴ‬
Dart language
> DartͷϥΠϒϥϦͱ࣮ͯ͠૷
• ಛఆͷϓϥοτϑΥʔϜʹґଘ͠ͳ͍࣮૷
• Web & CLI + Flutter
> Dartͷnull-safetyΛࢼ͔ͨͬͨ͠
http://
> _
Dart : Native, JavaScript
Flutter : Android, iOS, Web
ࠓ͠͹Β͘͸‫ػ‬ೳվળͯ͠·͢
CASL2࢖͏࣌ͷબ୒ࢶʹ!
͋Γ͕ͱ͏͍͟͝·ͨ͠
͓͢͢Ίͷॻ੶ͱ͔͋Ε͹‫!͍ͩͯ͑͘͞ڭ‬

Weitere ähnliche Inhalte

Was ist angesagt?

Eincop Netwax Lab: Redistribution
Eincop Netwax Lab: RedistributionEincop Netwax Lab: Redistribution
Eincop Netwax Lab: RedistributionNetwax Lab
 
Nxll21 ospf filtering & summarization
Nxll21 ospf filtering & summarizationNxll21 ospf filtering & summarization
Nxll21 ospf filtering & summarizationNetwax Lab
 
Nxll25 hsrp with failover
Nxll25 hsrp with failoverNxll25 hsrp with failover
Nxll25 hsrp with failoverNetwax Lab
 
Eincop Netwax Lab: Access List ii
Eincop Netwax Lab: Access List iiEincop Netwax Lab: Access List ii
Eincop Netwax Lab: Access List iiNetwax Lab
 
#3 - Git - Branching e Merging
#3 - Git - Branching e Merging#3 - Git - Branching e Merging
#3 - Git - Branching e MergingRodrigo Branas
 
Nxll17 dynamic routing with asa
Nxll17 dynamic routing with asaNxll17 dynamic routing with asa
Nxll17 dynamic routing with asaNetwax Lab
 
Nxll09 access list
Nxll09 access listNxll09 access list
Nxll09 access listNetwax Lab
 
DevLove k8s nobusue 20180711
DevLove k8s nobusue 20180711DevLove k8s nobusue 20180711
DevLove k8s nobusue 20180711Nobuhiro Sue
 
Nxll10 v lan and trunking
Nxll10 v lan and trunkingNxll10 v lan and trunking
Nxll10 v lan and trunkingNetwax Lab
 
Route Redistribution
Route RedistributionRoute Redistribution
Route RedistributionNetwax Lab
 
Build a minial DBMS from scratch by Rust
Build a minial DBMS from scratch by RustBuild a minial DBMS from scratch by Rust
Build a minial DBMS from scratch by Rust安齊 劉
 
Eincop Netwax Lab: HSRP (Hot Standby Router Protocol)
Eincop Netwax Lab: HSRP (Hot Standby Router Protocol)Eincop Netwax Lab: HSRP (Hot Standby Router Protocol)
Eincop Netwax Lab: HSRP (Hot Standby Router Protocol)Netwax Lab
 
Eincop Netwax Lab: Site 2 Site VPN with Routing Protocols
Eincop Netwax Lab: Site 2 Site VPN with Routing ProtocolsEincop Netwax Lab: Site 2 Site VPN with Routing Protocols
Eincop Netwax Lab: Site 2 Site VPN with Routing ProtocolsNetwax Lab
 
Eincop Netwax Lab: Vlan and Trunking ii
Eincop Netwax Lab: Vlan and Trunking iiEincop Netwax Lab: Vlan and Trunking ii
Eincop Netwax Lab: Vlan and Trunking iiNetwax Lab
 
ハイパフォーマンスブラウザネットワーキング2
ハイパフォーマンスブラウザネットワーキング2ハイパフォーマンスブラウザネットワーキング2
ハイパフォーマンスブラウザネットワーキング2Shuya Osaki
 
Python performance engineering in 2017
Python performance engineering in 2017Python performance engineering in 2017
Python performance engineering in 2017Alex Chistyakov
 

Was ist angesagt? (20)

Eincop Netwax Lab: Redistribution
Eincop Netwax Lab: RedistributionEincop Netwax Lab: Redistribution
Eincop Netwax Lab: Redistribution
 
Nxll21 ospf filtering & summarization
Nxll21 ospf filtering & summarizationNxll21 ospf filtering & summarization
Nxll21 ospf filtering & summarization
 
Nxll25 hsrp with failover
Nxll25 hsrp with failoverNxll25 hsrp with failover
Nxll25 hsrp with failover
 
Nxll23 i pv6
Nxll23 i pv6Nxll23 i pv6
Nxll23 i pv6
 
Eincop Netwax Lab: Access List ii
Eincop Netwax Lab: Access List iiEincop Netwax Lab: Access List ii
Eincop Netwax Lab: Access List ii
 
#3 - Git - Branching e Merging
#3 - Git - Branching e Merging#3 - Git - Branching e Merging
#3 - Git - Branching e Merging
 
Nxll11 bgp
Nxll11 bgpNxll11 bgp
Nxll11 bgp
 
Nxll24 i pv6
Nxll24 i pv6Nxll24 i pv6
Nxll24 i pv6
 
Nxll17 dynamic routing with asa
Nxll17 dynamic routing with asaNxll17 dynamic routing with asa
Nxll17 dynamic routing with asa
 
Nxll09 access list
Nxll09 access listNxll09 access list
Nxll09 access list
 
DevLove k8s nobusue 20180711
DevLove k8s nobusue 20180711DevLove k8s nobusue 20180711
DevLove k8s nobusue 20180711
 
Nxll10 v lan and trunking
Nxll10 v lan and trunkingNxll10 v lan and trunking
Nxll10 v lan and trunking
 
Route Redistribution
Route RedistributionRoute Redistribution
Route Redistribution
 
Build a minial DBMS from scratch by Rust
Build a minial DBMS from scratch by RustBuild a minial DBMS from scratch by Rust
Build a minial DBMS from scratch by Rust
 
Eincop Netwax Lab: HSRP (Hot Standby Router Protocol)
Eincop Netwax Lab: HSRP (Hot Standby Router Protocol)Eincop Netwax Lab: HSRP (Hot Standby Router Protocol)
Eincop Netwax Lab: HSRP (Hot Standby Router Protocol)
 
Eincop Netwax Lab: Site 2 Site VPN with Routing Protocols
Eincop Netwax Lab: Site 2 Site VPN with Routing ProtocolsEincop Netwax Lab: Site 2 Site VPN with Routing Protocols
Eincop Netwax Lab: Site 2 Site VPN with Routing Protocols
 
Eincop Netwax Lab: Vlan and Trunking ii
Eincop Netwax Lab: Vlan and Trunking iiEincop Netwax Lab: Vlan and Trunking ii
Eincop Netwax Lab: Vlan and Trunking ii
 
Hardgroup - Raspberry PI #1
Hardgroup - Raspberry PI #1Hardgroup - Raspberry PI #1
Hardgroup - Raspberry PI #1
 
ハイパフォーマンスブラウザネットワーキング2
ハイパフォーマンスブラウザネットワーキング2ハイパフォーマンスブラウザネットワーキング2
ハイパフォーマンスブラウザネットワーキング2
 
Python performance engineering in 2017
Python performance engineering in 2017Python performance engineering in 2017
Python performance engineering in 2017
 

Mehr von asuka y

易しいVim
易しいVim易しいVim
易しいVimasuka y
 
Async await完全に理解した
Async await完全に理解したAsync await完全に理解した
Async await完全に理解したasuka y
 
Go1.18 Genericsを試す
Go1.18 Genericsを試すGo1.18 Genericsを試す
Go1.18 Genericsを試すasuka y
 
Flutter2
Flutter2Flutter2
Flutter2asuka y
 
k8sクラスタ構築
k8sクラスタ構築k8sクラスタ構築
k8sクラスタ構築asuka y
 
自宅ネットワーク構築
自宅ネットワーク構築自宅ネットワーク構築
自宅ネットワーク構築asuka y
 

Mehr von asuka y (6)

易しいVim
易しいVim易しいVim
易しいVim
 
Async await完全に理解した
Async await完全に理解したAsync await完全に理解した
Async await完全に理解した
 
Go1.18 Genericsを試す
Go1.18 Genericsを試すGo1.18 Genericsを試す
Go1.18 Genericsを試す
 
Flutter2
Flutter2Flutter2
Flutter2
 
k8sクラスタ構築
k8sクラスタ構築k8sクラスタ構築
k8sクラスタ構築
 
自宅ネットワーク構築
自宅ネットワーク構築自宅ネットワーク構築
自宅ネットワーク構築
 

Kürzlich hochgeladen

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 

Kürzlich hochgeladen (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 

CASL2実行環境紹介

  • 1. CASL2 ࣮ߦ‫঺ڥ؀‬հ Feb 9 2021 / asuka y COMET2 Emulator ࡞ͬͯΈͨ
  • 2. ‫ܦ‬Ң ੵಡ stack ࣗ࡞ΤϛϡϨʔλͰֶͿx86ΞʔΩςΫνϟ ISBN 978-4-8399-5474-1 30೔ͰͰ͖Δ! OSࣗ࡞ೖ໳ ISBN 978-4-8399-1984-9 ࢼ͠ʹɺ Կ͔؆୯ͳΤϛϡϨʔλ Λ࣮૷͍ͨ͠ɻ RustͰ࣮૷
  • 4. COMET2/CASL2ͱ͸ COMET2 > COMET2༻ͷԾ૝ΞηϯϒϦ > NASMʹࣅͨ‫ه‬๏ > 36໋ྩͱগͳ͘γϯϓϧ CASL2 > 16bitsͷԾ૝ίϯϐϡʔλ > 1‫ͨ·ޠ‬͸2‫ޠ‬ͷCISCϓϩηοα IPA : ࢼ‫͢༻࢖Ͱݧ‬Δ৘ใٕज़ʹؔ͢Δ༻‫ޠ‬ɾϓϩάϥϜ‫Ͳͳޠݴ‬ Ver.4.2 > Ξηϯϒϥ‫ޠݴ‬ͷ࢓༷ https://www.jitec.ipa.go.jp/1_13download/shiken_yougo_ver4_2.pdf
  • 6. ઃ‫ܭ‬ MAIN START LAD GR1,0 ; var start = 0 LAD GR0,63 ; var end = 63 XOR GR2,GR2 ; var fizz_count = 0 XOR GR3,GR3 ; var buzz_count = 0 XOR GR4,GR4 ; var fizz_buzz_cout = 0 LAD GR5,3 ; final fizz = 3 LAD GR6,5 ; final buzz = 5 LAD GR7,15 ; final fizz_buzz = 15 ; for (var i = start; i < end; i++) LOOP CPL GR1,GR0 JZE EXIT LAD GR1,1,GR1 LAD GR2,1,GR2 ; fizz_count += 1 LAD GR3,1,GR3 ; buzz_count += 1 LAD GR4,1,GR4 ; fizz_buzz_count += 1 CPL GR4,GR7 ; if (fizz_buzz_count == 15) JZE FZBZ CPL GR3,GR6 ; if (buzz_count == 5) JZE BZ CPL GR2,GR5 ; IF (fizz_count == 3) JZE FZ OUT DOT,255 JUMP LOOP FZBZ OUT FIZZ,255 LAD GR4,0 Hello, world. INPUT OUTPUT
  • 7. ઃ‫ܭ‬ MAIN START LAD GR1,0 ; var start = 0 LAD GR0,63 ; var end = 63 XOR GR2,GR2 ; var fizz_count = 0 XOR GR3,GR3 ; var buzz_count = 0 XOR GR4,GR4 ; var fizz_buzz_cout = 0 LAD GR5,3 ; final fizz = 3 LAD GR6,5 ; final buzz = 5 LAD GR7,15 ; final fizz_buzz = 15 ; for (var i = start; i < end; i++) LOOP CPL GR1,GR0 JZE EXIT LAD GR1,1,GR1 LAD GR2,1,GR2 ; fizz_count += 1 LAD GR3,1,GR3 ; buzz_count += 1 LAD GR4,1,GR4 ; fizz_buzz_count += 1 CPL GR4,GR7 ; if (fizz_buzz_count == 15) JZE FZBZ CPL GR3,GR6 ; if (buzz_count == 5) JZE BZ CPL GR2,GR5 ; IF (fizz_count == 3) JZE FZ OUT DOT,255 JUMP LOOP FZBZ OUT FIZZ,255 LAD GR4,0 Hello, world. INPUT OUTPUT ೖྗΛஞ࣍ղऍͯ͠ग़ྗ͢Δํ๏ͰΤϛϡϨʔλΛ࣮૷͠Α͏ͱͯ͠‫׬‬੒ͤͣ
  • 8. ‫ݪ‬Ҽ ͍͘ΒΞηϯϒϦͷ໋ྩ͕‫ػ‬ց‫ޠ‬ ͷ໋ྩͱ1 : 1ͱ͸͍͑ɺೖྗˠग़ྗ ͷม‫׵‬΋ৗʹ1 : 1Ͱ͸ͳ͍ɻ LOAD໋ྩ • LD GR1,GR0 var x = y • LD GR1,0 var x = 0 • LD GR1,1,GR1 x += 1 if instruction equal load: if operand match pattern1: // any… else if operand match pattern2: // any… else if operand match pattern3: // any…
  • 9. ࠶ઃ‫ܭ‬ MAIN START LAD GR1,0 ; var start = 0 LAD GR0,63 ; var end = 63 XOR GR2,GR2 ; var fizz_count = 0 XOR GR3,GR3 ; var buzz_count = 0 XOR GR4,GR4 ; var fizz_buzz_cout = 0 LAD GR5,3 ; final fizz = 3 LAD GR6,5 ; final buzz = 5 LAD GR7,15 ; final fizz_buzz = 15 ; for (var i = start; i < end; i++) LOOP CPL GR1,GR0 JZE EXIT LAD GR1,1,GR1 LAD GR2,1,GR2 ; fizz_count += 1 LAD GR3,1,GR3 ; buzz_count += 1 LAD GR4,1,GR4 ; fizz_buzz_count += 1 CPL GR4,GR7 ; if (fizz_buzz_count == 15) JZE FZBZ CPL GR3,GR6 ; if (buzz_count == 5) JZE BZ CPL GR2,GR5 ; IF (fizz_count == 3) JZE FZ OUT DOT,255 JUMP LOOP FZBZ OUT FIZZ,255 LAD GR4,0 Hello, world. INPUT OUTPUT 1ͭͷॲཧʹશͯΛ࣮૷ͤͣɺ‫ػ‬ೳຖʹ࣮૷ͯ͠૊Έ߹ΘͤΔ͜ͱͰ࣮‫ݱ‬ ղऍ ม‫׵‬ ࣮ߦ
  • 10. ࠶ઃ‫ܭ‬ GR0: 21 COMET2 ࣮ߦ‫ڥ؀‬ ໋ྩ Ϩδελ/ϝϞϦ 0x1000 0x0007 0x1210 0x0001 0x2001 0x0007 0x8100 0x000A 0x000B CASL2 ղੳ‫ث‬ MAIN START LD GR0,VAL LAD GR1,1 ADDA GR0,VAL,GR1 RET VAL DC 10,11 END ղऍɾม‫׵‬ ࣮ߦ
  • 11. > ςετ͕ॻ͖΍͍͢ • ೖྗ஋ʹཚ਺Λ༻͍ͨςετ > ࣮૷͕༰қʹ • ίʔυͷ੹೚ൣғ͕໌֬ > εςʔτϨεͳ࣮૷ • ঢ়ଶ͸֎͔Β༩͑ΒΕΔ > ೖྗʹରͯ͠Ұҙͳग़ྗʹ͢Δ • ࣮ߦ݁Ռ͕ਪଌ͠΍͘͢ͳΔ ҙ͍ࣝͯ͠Δ͜ͱ void noOperation(final Resource r) { final pr = r.programRegister; pr.value += 1; } final casl2 = Casl2(); final comet2 = Comet2(); final code = casl2.compile(asm); comet2.load(code); comet2.exec();
  • 12. ࣮૷‫ޠݴ‬ Dart language > DartͷϥΠϒϥϦͱ࣮ͯ͠૷ • ಛఆͷϓϥοτϑΥʔϜʹґଘ͠ͳ͍࣮૷ • Web & CLI + Flutter > Dartͷnull-safetyΛࢼ͔ͨͬͨ͠ http:// > _ Dart : Native, JavaScript Flutter : Android, iOS, Web