Answer To: Microsoft Word - Lab2.docx Lab #2 CoSc 20203 Fall 2021 ARM Machine Instructions Due: Thursday Sept...
Ramachandran answered on Sep 30 2021
Order-92301/jar/ARM.jar
META-INF/MANIFEST.MF
Manifest-Version: 1.0
Main-Class: com.arm.Application
com/arm/Application.class
package com.arm;
public synchronized class Application {
private static javax.swing.JTextField instructionTextField;
private static ArmEncoder armEncoder;
private static javax.swing.JLabel errorLabel;
private static javax.swing.JTextField hexInstructionTextField;
private static javax.swing.JTextField binaryInstructionTextField;
public void Application();
public static void main(String[]);
private static java.awt.event.ActionListener binaryDecodeButtonActionListener();
private static java.awt.event.ActionListener hexDecodeButtonActionListener();
private static java.awt.event.ActionListener encodeButtonActionListener();
static javax.swing.JTextField createTextField(int, String);
static javax.swing.JLabel createLabel(int, String);
static javax.swing.JButton createButton(int, String);
}
com/arm/ArmEncoder$1.class
package com.arm;
final synchronized class ArmEncoder$1 extends java.util.HashMap {
void ArmEncoder$1();
}
com/arm/ArmEncoder$Type.class
package com.arm;
final synchronized enum ArmEncoder$Type {
public static final ArmEncoder$Type HEX;
public static final ArmEncoder$Type BINARY;
public static ArmEncoder$Type[] values();
public static ArmEncoder$Type valueOf(String);
private void ArmEncoder$Type(String, int);
static void ();
}
com/arm/ArmEncoder.class
package com.arm;
public synchronized class ArmEncoder {
private static final int ARM_INSTRUCTION_LENGTH = 32;
private static final String ADD = ADD;
private static final String AND = AND;
private static final String EOR = EOR;
private static final String SUB = SUB;
private static final String RSB = RSB;
private static final String ADC = ADC;
private static final String SBC = SBC;
private static final String RSC = RSC;
private static final String TST = TST;
private static final String TEQ = TEQ;
private static final String CMP = CMP;
private static final String CMN = CMN;
private static final String ORR = ORR;
private static final String MOV = MOV;
private static final String BIC = BIC;
private static final String MVN = MVN;
private static final java.util.Map OPERATOR_CODE_MAP;
public void ArmEncoder();
public String encode(String) throws Exception;
public String decode(String, ArmEncoder$Type) throws Exception;
public String convertHexToBinary(String) throws Exception;
public String convertBinaryToHex(String) throws Exception;
private String buildInstruction(String, String, String, String);
private String parseRegisterBinary(String) throws Exception;
private String parseRegisterString(String) throws Exception;
private String findOperatorByCode(String) throws Exception;
private String findOperatorByName(String) throws Exception;
static void ();
}
com/arm/ImagePanel.class
package com.arm;
synchronized class ImagePanel extends javax.swing.JPanel {
private final java.awt.Image img;
public void ImagePanel(String);
public void ImagePanel(java.awt.Image);
public void paintComponent(java.awt.Graphics);
}
images/background.jpg
Order-92301/javadoc/allclasses-frame.html
All Classes
Application
ArmEncoder
Order-92301/javadoc/allclasses-noframe.html
All Classes
Application
ArmEncoder
Order-92301/javadoc/com/arm/Application.html
JavaScript is disabled on your browser.
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev Class
Next Class
Frames
No Frames
All Classes
Summary:
Nested |
Field |
Constr |
Method
Detail:
Field |
Constr |
Method
com.arm
Class Application
java.lang.Object
com.arm.Application
public class Application
extends java.lang.Object
Main Class which creates the application.
Constructor Summary
Constructors Constructor and Description
Application()
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description
static void main(java.lang.String[] args)
Program execution begins from this method.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail
Application
public Application()
Method Detail
main
public static void main(java.lang.String[] args)
Program execution begins from this method.
This method creates and manages the GUI
Parameters:
args - external arguments
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev Class
Next Class
Frames
No Frames
All Classes
Summary:
Nested |
Field |
Constr |
Method
Detail:
Field |
Constr |
Method
Order-92301/javadoc/com/arm/ArmEncoder.html
JavaScript is disabled on your browser.
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev Class
Next Class
Frames
No Frames
All Classes
Summary:
Nested |
Field |
Constr |
Method
Detail:
Field |
Constr |
Method
com.arm
Class ArmEncoder
java.lang.Object
com.arm.ArmEncoder
public class ArmEncoder
extends java.lang.Object
Class used to encode and decode an ARM Instruction
Constructor Summary
Constructors Constructor and Description
ArmEncoder()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description
java.lang.String convertBinaryToHex(java.lang.String binary)
method to convert binary string to hex string
java.lang.String convertHexToBinary(java.lang.String hex)
method to convert hex string to a binary string
java.lang.String decode(java.lang.String input,
com.arm.ArmEncoder.Type type)
method to decode the 32 bit ARM instruction set
0-6 - 7 bits hardcoded [1110000]
7-10 - 4 bits opcode
11-11 - 1 bits hardcoded [0]
12-15 - 4 bits op 1 reg
16-19 - 4 bits dest reg
20-27 - 8 bits hardcoded [00000000]
28-31 - 4 bits op 2reg
java.lang.String encode(java.lang.String input)
method to encode an input arm instruction
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail
ArmEncoder
public ArmEncoder()
Method Detail
encode
public java.lang.String encode(java.lang.String input)
throws java.lang.Exception
method to encode an input arm instruction
Parameters:
input - arm instruction
Returns:
32 bit ARM binary instruction set
Throws:
java.lang.Exception - if unable to encode, exception message contains reason
decode
public java.lang.String decode(java.lang.String input,
com.arm.ArmEncoder.Type type)
throws java.lang.Exception
method to decode the 32 bit ARM instruction set
0-6 - 7 bits hardcoded [1110000]
7-10 - 4 bits opcode
11-11 - 1 bits hardcoded [0]
12-15 - 4 bits op 1 reg
16-19 - 4 bits dest reg
20-27 - 8 bits hardcoded [00000000]
28-31 - 4 bits op 2reg
Parameters:
input - instruction set
type - representation of the input (HEX, BINARY)
Returns:
decoded instruction
Throws:
java.lang.Exception - if unable to decode, exception message contains reason
convertHexToBinary
public java.lang.String convertHexToBinary(java.lang.String hex)
throws java.lang.Exception
method to convert hex string to a binary string
Parameters:
hex - hex string
Returns:
binary string
Throws:
java.lang.Exception
convertBinaryToHex
public java.lang.String convertBinaryToHex(java.lang.String binary)
throws java.lang.Exception
method to convert binary string to hex string
Parameters:
binary - binary string
Returns:
hex string
Throws:
java.lang.Exception
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev Class
Next Class
Frames
No Frames
All Classes
Summary:
Nested |
Field |
Constr |
Method
Detail:
Field |
Constr |
Method
Order-92301/javadoc/com/arm/package-frame.html
com.arm
Classes
Application
ArmEncoder
Order-92301/javadoc/com/arm/package-summary.html
JavaScript is disabled on your browser.
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev Package
Next Package
Frames
No Frames
All Classes
Package com.arm
Class Summary Class Description
Application
Main Class which creates the application.
ArmEncoder
Class used to encode and decode an ARM Instruction
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev Package
Next Package
Frames
No Frames
All Classes
Order-92301/javadoc/com/arm/package-tree.html
JavaScript is disabled on your browser.
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev
Next
Frames
No Frames
All Classes
Hierarchy For Package com.arm
Class Hierarchy
java.lang.Object
com.arm.Application
com.arm.ArmEncoder
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev
Next
Frames
No Frames
All Classes
Order-92301/javadoc/constant-values.html
JavaScript is disabled on your browser.
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev
Next
Frames
No Frames
All Classes
Constant Field Values
Contents
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev
Next
Frames
No Frames
All Classes
Order-92301/javadoc/deprecated-list.html
JavaScript is disabled on your browser.
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev
Next
Frames
No Frames
All Classes
Deprecated API
Contents
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev
Next
Frames
No Frames
All Classes
Order-92301/javadoc/help-doc.html
JavaScript is disabled on your browser.
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev
Next
Frames
No Frames
All Classes
How This API Document Is Organized
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
Package
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
Interfaces (italic)
Classes
Enums
Exceptions
Errors
Annotation Types
Class/Interface
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
Class inheritance diagram
Direct Subclasses
All Known Subinterfaces
All Known Implementing Classes
Class/interface declaration
Class/interface description
Nested Class Summary
Field Summary
Constructor Summary
Method Summary
Field Detail
Constructor Detail
Method Detail
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
Annotation Type
Each annotation type has its own separate page with the following sections:
Annotation Type declaration
Annotation Type description
Required Element Summary
Optional Element Summary
Element Detail
Enum
Each enum has its own separate page with the following sections:
Enum declaration
Enum description
Enum Constant Summary
Enum Constant Detail
Tree (Class Hierarchy)
There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
Deprecated API
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
Index
The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
Prev/Next
These links take you to the next or previous class, interface, package, or related page.
Frames/No Frames
These links show and hide the HTML frames. All pages are available with or without frames.
All Classes
The All Classes link shows all classes and interfaces except non-static nested types.
Serialized Form
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
Constant Field Values
The Constant Field Values page lists the static final fields and their values.
This help file applies to API documentation generated using the standard doclet.
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev
Next
Frames
No Frames
All Classes
Order-92301/javadoc/index.html
Order-92301/javadoc/index-files/index-1.html
JavaScript is disabled on your browser.
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes
A C D E M
A
Application - Class in com.arm
Main Class which creates the application.
Application() - Constructor for class com.arm.Application
ArmEncoder - Class in com.arm
Class used to encode and decode an ARM Instruction
ArmEncoder() - Constructor for class com.arm.ArmEncoder
A C D E M
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes
Order-92301/javadoc/index-files/index-2.html
JavaScript is disabled on your browser.
Skip navigation links
Package
Class
Tree
Deprecated
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes
A C D E M
C
com.arm - package com.arm
convertBinaryToHex(String) - Method in class com.arm.ArmEncoder
method to convert binary string to hex string
convertHexToBinary(String) - Method in class...